package kuaizu.common.template;

import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author: wangmx15
 * @date: 2025/8/24
 * 管理员审核模版
 **/
@Data
public class ProjectReviewMassageTemp {
    private thing1 thing1;
    private date3 date3;
    private phrase5 phrase5;


    @Data
    public static class thing1 {
        private String value;
    }

    @Data
    public static class date3 {
        private String value;
    }

    @Data
    public static class phrase5 {
        private String value;
    }    //设置模板参数

    public void setTemplateParam(String projectName, boolean status,String text) {
        this.thing1 = new ProjectReviewMassageTemp.thing1();
        this.date3 = new ProjectReviewMassageTemp.date3();
        this.phrase5 = new ProjectReviewMassageTemp.phrase5();
//设置语句
        if (projectName.length()>20) {
            String substring = projectName.substring(0, 16);
            projectName=substring+"...";
        }
        thing1.setValue(projectName);
        if (status) {
            phrase5.setValue("审核通过");
        } else {
            phrase5.setValue("审核被拒绝");
        }
        //获取当前时间格式为 2019年10月1日 15:52
        LocalDateTime now = LocalDateTime.now();
        date3.setValue(now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm")));
    }


}
